<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
		<script type="text/javascript" src="js/md5.js"></script>
		
		<script type="text/javascript">
	$(function()
	{
		$("#button1").click(function()
		{
	  var m = hex_md5($("#2").val());
			$.ajax({
				type: "POST",
				url: "userLogin",
				dateType: "json",
				data: {"username": $("#1").val(), "password": m},
				success: function(returnedData){
						
						var json = eval( "("+returnedData+")" );
						alert(json.username);
						var str = "姓名:" + json.username + "<br />"; str += "密码:" 
						+ json.pwd + "<br />";
						$("#3").html(str);
				}
			});
		});
	});
	
	

	</script>

	</head>
	<body>
		<input type="text" id="1" value="venus">
		<br />
		<input type="text" id="2" value="password">
		<br />
		<div id="3">
		<br />

		<input type="button" value="点我看看" id="button1" >

	</body>
</html>